<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>诊疗服务</title>
</head>
<body>
    <div>
        <div class="sname_list">
            <div class="title">诊疗项目</div> 
            <div id="sname"></div>
        </div>
        <div class="sintroduce_list">
            <div class="title">诊疗项目简介</div>
            <div id='sintroduce'></div>
        </div>
    </div>
    <script>
        // 查询诊疗项目简介
        var xhr=new XMLHttpRequest();
        xhr.onreadystatechange=function(){
            if(xhr.readyState===4&&xhr.status===200){
                var obj=JSON.parse(xhr.responseText);
                var sintroduce=document.getElementById('sintroduce');
                var htmlSintroduce=''
                var htmlSname=''
                // 诊疗项目详情
                for(var i=0;i<obj.data.length;i++){
                    htmlSintroduce+=`<div>${obj.data[i].sintroduce}</div>`
                }
                sintroduce.innerHTML=htmlSintroduce;
                // 诊疗项目
                for(var i=0;i<obj.data.length;i++){
                    htmlSname+=`<div>${obj.data[i].service_id}</div>`
                }
                sname.innerHTML=htmlSname;
            }
        }
        var url='/a1/srcontents/all2'
        xhr.open('GET',url,true);
        xhr.send();
    </script>
</body>
</html>